home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Inne
/
Gry
/
Carnage_Contest
/
scripts
/
CC Original
/
movement
/
Stealth Ninja.lua
< prev
next >
Wrap
Text File
|
2010-09-28
|
2KB
|
58 lines
--------------------------------------------------------------------------------
-- Weapon Stealht Ninja
-- Original Carnage Contest Weapon
-- Script by DC, September 2010, www.UnrealSoftware.de
--------------------------------------------------------------------------------
-- Setup Tables
if cc==nil then cc={} end
cc.stealth={}
-- Load & Prepare Ressources
cc.stealth.gfx_wpn=loadgfx("weapons/stealthninja.png") -- Weapon Image
setmidhandle(cc.stealth.gfx_wpn)
cc.stealth.sfx_heal=loadsfx("stealthninja.ogg")
--------------------------------------------------------------------------------
-- Weapon: Stealth Ninja
--------------------------------------------------------------------------------
cc.stealth.id=addweapon("cc.stealth","Stealth Ninja",cc.stealth.gfx_wpn,0) -- Add Weapon (0 uses)
function cc.stealth.draw() -- Draw
-- Do nothing!
end
function cc.stealth.attack(attack) -- Attack
if (weapon_shots<=0) then
if (attack==1) then
-- Use weapon and allow to use another one afterwards (1)
useweapon(1)
weapon_shots=weapon_shots+1
-- Make invisible
playerstate(0,state_invisible,1)
-- Effect
playsound(cc.stealth.sfx_heal)
x=getplayerx(0)
y=getplayery(0)+3
particle(p_muzzle,x,y)
particlesize(1,1)
particlecolor(255,0,150)
particlealpha(1.0)
particlefadealpha(0.01)
particle(p_muzzle,x,y)
particlesize(1,2)
particlecolor(255,0,150)
particlealpha(1.0)
particlefadealpha(0.02)
particlerotation(0)
for j=1,15,1 do
particle(p_flare,x-10.0+math.random()*20.0,y+math.random()*10.0)
particlesize(3.0,3.0)
particlecolor(255,0,150)
particlespeed(0,math.random(2,15)*-0.1)
particlefadealpha(0.01)
end
end
end
end